package chainOfResponsibility.example;

/**
 * 经理类( 经理权限只能批请假而且2天以内 )
 */
public class CommonManager extends Manager {

    public CommonManager() {
    }

    public CommonManager(String name) {
        super(name);
    }

    @Override
    public void requestApplication(Request request) {
        if (request.getRequestType().equals("请假") && request.getNumber() <= 2) {
            System.out.println(request.getRequestContent() + " 数量:" + request.getNumber() + " 被批准");
        } else {
            if (superior != null) {
                superior.requestApplication(request);
            }
        }
    }
}
